/**
 * 
 */
package org.t2.backstage.module.system.service;

import org.gaming.service.service.AbstractService;
import org.gaming.tool.DateTimeUtil;
import org.springframework.stereotype.Service;
import org.t2.backstage.module.system.model.SystemCounter;

/**
 * @author YY
 *
 */
@Service
public class SystemCounterService extends AbstractService<SystemCounter> {

	private SystemCounter instance;
	public SystemCounter instance() {
		if(instance == null) {
			synchronized (this) {
				instance = this.repository().getByKeys(1L);
				if(instance == null) {
					instance = new SystemCounter();
					instance.setId(1L);
					instance.setRemainTime(DateTimeUtil.currMillis());
					this.insert(instance);
				}
			}
		}
		return instance;
	}
	
	@Override
	public void mergeServer(int mergeDbZoneId) {
		//不必理会
	}
}
